package com.huiztech.kaoqinji.mvc;

import java.util.Map;

import com.huiztech.kaoqinji.LocApplication;
import com.lidroid.xutils.DbUtils;
import com.lidroid.xutils.util.LogUtils;

import android.app.Activity;
import android.os.Bundle;

public class KaoqinBaseActivity extends Activity {
    protected AbstractKaoqinController controller;
    protected KaoqinView view;
    protected Map<String, Object> model;
    private String name;
    SerializableMap map;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LogUtils.i("onCreate");
        map = new SerializableMap();
        controller = KaoqinControllerFactory.getInstance();
        controller.setContext(this);
        //   controller.initDb(controller.getContext());
        view = controller.getHuizView();
        model = controller.getHuizModel();
        map.setMap(model);

    }

    //    @Override
    //    protected void onSaveInstanceState(Bundle outState) {
    //        super.onSaveInstanceState(outState);
    //        LogUtils.i("onSaveInstanceState");
    //
    //       // outState.putSerializable("map", map);
    //    }
    //
    //    @Override
    //    protected void onRestoreInstanceState(Bundle savedInstanceState) {
    //        LogUtils.i("onRestoreInstanceState");
    //        map = (SerializableMap) savedInstanceState.get("map");
    //        model = map.getMap();
    //        super.onRestoreInstanceState(savedInstanceState);
    //    }

    @Override
    protected void onResume() {
        super.onResume();
        this.controller.setContext(this);
    }
}
